<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Auth;

class HouseRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return Auth::id() == 1;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => ['sometimes', 'between:5,100'],
            'url' => ['sometimes', 'nullable', 'url'],
            'content' => ['sometimes', 'min:30'],
            'click' => ['sometimes', 'nullable', 'numeric'],
        ];
    }
}
